
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:keep_account_web/bean/day_work_record.dart';
import 'package:keep_account_web/ui/monthly_work_record_title.dart';
import 'package:keep_account_web/ui/monthly_work_records_list.dart';
import 'package:keep_account_web/utils/getx_util.dart';
import 'package:keep_account_web/utils/screen_utils.dart';
import 'package:url_launcher/url_launcher.dart';

import '../view/dialog_utils.dart';
import '../vm/work_records_controller.dart';
import 'monthly_salary_line_chart.dart';

class HomeMain extends StatefulWidget {
  const HomeMain({super.key});


  @override
  State<StatefulWidget> createState() => _HomeMainState();
}

class _HomeMainState extends State<HomeMain> with SingleTickerProviderStateMixin{

  late final WorkRecordsController _controller = Get.put(WorkRecordsController());

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(builder: (ctx,constraints){
      var screenType = getCurrentScreenType(constraints);
      return Scaffold(
          appBar: AppBar(
            title: Container(
            margin: EdgeInsets.only(left: 50.getScaleUpWidth(screenType)),
            alignment: Alignment.centerLeft,
            child: Text("工作记录",style: Theme.of(context).textTheme.titleLarge,),),actions: [
              appBarAction(screenType)
          ],
          ),
          body: SingleChildScrollView(
            padding: EdgeInsets.all(10.getScaleUpWidth(screenType)),
            child: screenType == DeviceScreenType.large ? largeWidget() : middleSmallWidget(),
          )
      );
    });
  }

  Widget appBarAction(DeviceScreenType screenType){
    if (screenType == DeviceScreenType.small) {
      return Container(
        margin: const EdgeInsets.fromLTRB(0, 0, 20, 0),
        child: PopupMenuButton<int>(
          offset: const Offset(0,50),
          itemBuilder: (context){
            return <PopupMenuEntry<int>>[
              PopupMenuItem(value: 1,child: Text("历史记录",style: Theme.of(context).textTheme.titleSmall,),),
              PopupMenuItem(value: 2,child: Text("添加记录",style: Theme.of(context).textTheme.titleSmall,),),
              PopupMenuItem(value: 3,child: Text("退出登录",style: Theme.of(context).textTheme.titleSmall),),
            ];
          },
          onSelected: (key){
            switch(key){
              case 1:
                toNamed("/work_records_history");
              case 2:
                showAddWorkRecordsDialog(screenType);
                break;
              case 3:
                offAllNamed("/user_login");
                break;
            }
          },
        ),
      );
    }else {
      return Container(
        margin: EdgeInsets.only(right: 50.0.getScaleUpWidth(screenType)),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
              margin: EdgeInsets.only(right: 10.getScaleUpWidth(screenType)),
              child: InkWell(
                onTapDown: (d){
                  toNamed("/work_records_history");
                },
                child: const Text("历史记录",style: TextStyle(fontSize: 16),),
              ),
            ),
            Container(
              margin: EdgeInsets.only(right: 10.getScaleUpWidth(screenType)),
              child: InkWell(
                onTapDown: (d){
                  showAddWorkRecordsDialog(screenType);
                },
                child: const Text("添加记录",style: TextStyle(fontSize: 16),),
              ),
            ),
            InkWell(
              onTapDown: (d){
                offAllNamed("/user_login");
              },
              child: const Text("退出登录",style: TextStyle(fontSize: 16),),
            )
          ],
        ),
      );
    }
  }

  Widget largeWidget(){
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: [
        Expanded(child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Obx(() => MonthlyWorkRecordTitle(
                screenType: DeviceScreenType.large,
                monthlyWorkDays: _controller.monthlyWorkDays.value,
                monthlyTotalProduct: _controller.monthlyTotalProduct.value,
                monthlyTotalSingleProduct: _controller.monthlyTotalSingleProduct.value,
                monthlyTotalSalary: _controller.monthlyTotalSalary.value,
                yearTotalProduct: ((_controller.yearWorkRecord.value.teamQuantity ?? 0) + (_controller.yearWorkRecord.value.singleQuantity ?? .0)),
                yearTotalSingleProduct: _controller.yearWorkRecord.value.singleQuantity ?? .0,
                yearTotalSalary: _controller.yearWorkRecord.value.totalSalary ?? .0
            )),
            Obx(() => MonthlySalaryLineChart(
              screenType: DeviceScreenType.small,
              workRecords: _controller.yearGroupByMonthlyWorkRecords.value,
            )),
          ],
        )),
        SizedBox(width: 10.getScaleUpWidth(DeviceScreenType.large),),
        Obx(() => Visibility(
            maintainAnimation: false,
            maintainSize: false,
            maintainState: false,
            child: Expanded(
                child: MonthlyWorkRecordsList(
                    screenType: DeviceScreenType.large,
                    workRecords: _controller.currentMonthlyWorkRecords.value,
                    onLongClickListener: (data){
                      showUpdateRecordsDialog(data);
                    })
            )
        )),
        Obx(() => Visibility(
            visible: _controller.currentMonthlyWorkRecords.isEmpty,
            maintainAnimation: false,
            maintainSize: false,
            maintainState: false,
            child: const Expanded(child: SelectableText("本月没有上班哦")))),
        SizedBox(width: 10.getScaleUpWidth(DeviceScreenType.large),),
      ],
    );
  }

  Widget middleSmallWidget(){
    return Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Obx(() => MonthlyWorkRecordTitle(
            screenType: DeviceScreenType.large,
            monthlyWorkDays: _controller.monthlyWorkDays.value,
            monthlyTotalProduct: _controller.monthlyTotalProduct.value,
            monthlyTotalSingleProduct: _controller.monthlyTotalSingleProduct.value,
            monthlyTotalSalary: _controller.monthlyTotalSalary.value,
            yearTotalProduct: ((_controller.yearWorkRecord.value.teamQuantity ?? 0) + (_controller.yearWorkRecord.value.singleQuantity ?? .0)),
            yearTotalSingleProduct: _controller.yearWorkRecord.value.singleQuantity ?? .0,
            yearTotalSalary: _controller.yearWorkRecord.value.totalSalary ?? .0
        )),
        Obx(() => MonthlySalaryLineChart(
          screenType: DeviceScreenType.small,
          workRecords: _controller.yearGroupByMonthlyWorkRecords.value,
        )),
        Obx(() => MonthlyWorkRecordsList(
            screenType: DeviceScreenType.middle,
            workRecords: _controller.currentMonthlyWorkRecords.value,
            onLongClickListener: (data){
              showUpdateRecordsDialog(data);
            }
        )
        ),
        Obx(() => Visibility(
            visible: _controller.currentMonthlyWorkRecords.isEmpty,
            maintainAnimation: false,
            maintainSize: false,
            maintainState: false,
            child: Container(
              margin: EdgeInsets.only(top: 50.getScaleUpWidth(DeviceScreenType.small)),
              child: const SelectableText("本月没有上班哦"),
            ))),
        copyRight()
      ],
    );
  }

  void showUpdateRecordsDialog(DayWorkRecord workRecords) async {
    _controller.updatePrice.text = "${workRecords.productPrice ?? .0}";
    _controller.updateQuantity.text = "${workRecords.productQuantity ?? 0}";
    _controller.updateTeamSize.text = "${workRecords.teamSize ?? 0}";
    _controller.updateSingleQuantity.text = "${workRecords.singleQuantity ?? 0}";
    if((workRecords.teamSize ?? 0) ==0){
      _controller.updateWorkTypeGroup.value = _controller.updateSinglePersonWork;
    }else if((workRecords.singleQuantity ?? 0) == 0 ){
      _controller.updateWorkTypeGroup.value = _controller.updateMultiPersonWork;
    }else if ((workRecords.singleQuantity ?? 0) > 0 && (workRecords.teamSize ?? 0) > 1){
      _controller.updateWorkTypeGroup.value = _controller.updateMixedWork;
    }

    await showDialog(
        context: context,
        builder: (ctx){
          return AlertDialog(
            shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(10))
            ),
            title: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                const Text("提示"),
                TextButton(
                    onPressed: (){
                      Get.back();
                      showSureDeleteWorkRecord(
                          context: context,
                          date: workRecords.workDate ?? "",
                          sureDelete: (){
                            _controller.deleteWorkRecords(workRecords.id ?? 0);
                          });
                    },
                    child: const Text("删除记录",style: TextStyle(fontSize: 18),)
                ),
              ],
            ),
            titlePadding: const EdgeInsets.only(top: 20,left: 15,right: 10,bottom: 0),
            contentPadding: const EdgeInsets.only(left: 20,right: 20,top: 0),
            content: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.min,
              children: [
                const SizedBox(width: double.infinity,height: 10,),
                Row(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Obx(()=>Radio<int>(
                      value: _controller.updateSinglePersonWork,
                      groupValue: _controller.updateWorkTypeGroup.value,
                      onChanged: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateSinglePersonWork;
                      },
                    )
                    ),
                    GestureDetector(
                      child: Text("个人",style: Theme.of(context).textTheme.titleSmall,),
                      onTapUp: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateSinglePersonWork;
                      },
                    ),
                    Obx(()=>Radio<int>(
                      value: _controller.updateMultiPersonWork,
                      groupValue: _controller.updateWorkTypeGroup.value,
                      onChanged: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateMultiPersonWork;
                      },
                    )
                    ),
                    GestureDetector(
                      child: Text("多人",style: Theme.of(context).textTheme.titleSmall),
                      onTapUp: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateMultiPersonWork;
                      },
                    ),
                    Obx(()=>Radio<int>(
                      value: _controller.updateMixedWork,
                      groupValue: _controller.updateWorkTypeGroup.value,
                      onChanged: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateMixedWork;
                      },
                    )
                    ),
                    GestureDetector(
                      child: Text("混合",style: Theme.of(context).textTheme.titleSmall),
                      onTapUp: (d){
                        clearInputText();
                        _controller.updateWorkTypeGroup.value = _controller.updateMixedWork;
                      },
                    ),
                  ],
                ),
                Obx(() => Visibility(
                  visible: _controller.updateWorkTypeGroup.value != _controller.updateMultiPersonWork,
                  maintainAnimation: false,
                  maintainSize: false,
                  maintainState: false,
                  child: Container(
                    margin: const EdgeInsets.only(top: 20,left: 15,right: 15),
                    child: TextField(
                      textAlign: TextAlign.center,
                      controller: _controller.updateSingleQuantity,
                      style: Theme.of(context).textTheme.bodySmall,
                      decoration: InputDecoration(
                          labelText: "个人产品数量",
                          hintText: "请输入个人产品数量",
                          hintStyle: Theme.of(context).textTheme.bodySmall,
                          border: UnderlineInputBorder(
                              borderSide: BorderSide(width: .1,color: Theme.of(context).colorScheme.primary)
                          ),
                          labelStyle: Theme.of(context).textTheme.bodySmall
                      ),
                    ),
                  ),
                ),),
                Obx(() => Visibility(
                  visible: _controller.updateWorkTypeGroup.value != _controller.updateSinglePersonWork,
                  maintainAnimation: false,
                  maintainSize: false,
                  maintainState: false,
                  child: Container(
                    margin: const EdgeInsets.only(top: 20,left: 15,right: 15),
                    child: TextField(
                      textAlign: TextAlign.center,
                      controller: _controller.updateQuantity,
                      style: Theme.of(context).textTheme.bodySmall,
                      decoration: InputDecoration(
                          labelText: "多人产品数量",
                          hintText: "请输入多人产品数量",
                          hintStyle: Theme.of(context).textTheme.bodySmall,
                          border: UnderlineInputBorder(
                              borderSide: BorderSide(width: .1,color: Theme.of(context).colorScheme.primary)
                          ),
                          labelStyle: Theme.of(context).textTheme.bodySmall
                      ),
                    ),
                  ),
                )),
                Container(
                  margin: const EdgeInsets.only(top: 10,left: 15,right: 15),
                  child: TextField(
                    textAlign: TextAlign.center,
                    controller: _controller.updatePrice,
                    style: Theme.of(context).textTheme.bodySmall,
                    decoration: InputDecoration(
                        labelText: "产品单价",
                        hintText: "请输入产品单价",
                        hintStyle: Theme.of(context).textTheme.bodySmall,
                        border: const UnderlineInputBorder(),
                        labelStyle: Theme.of(context).textTheme.bodySmall
                    ),
                  ),
                ),
                Obx(() => Visibility(
                  visible: _controller.updateWorkTypeGroup.value != _controller.updateSinglePersonWork,
                  maintainAnimation: false,
                  maintainSize: false,
                  maintainState: false,
                  child: Container(
                    margin: const EdgeInsets.only(top: 10,left: 15,right: 15),
                    child: TextField(
                      textAlign: TextAlign.center,
                      controller: _controller.updateTeamSize,
                      style: Theme.of(context).textTheme.bodySmall,
                      decoration: InputDecoration(
                          labelText: "团队人数",
                          hintText: "请输入团队人数",
                          hintStyle: Theme.of(context).textTheme.bodySmall,
                          border: const UnderlineInputBorder(),
                          labelStyle: Theme.of(context).textTheme.bodySmall
                      ),
                    ),),
                )),
              ],
            ),
            actionsPadding: const EdgeInsets.only(top: 10,bottom: 20,right: 20),
            actions: [
              TextButton(onPressed: (){Get.back();}, child: const Text("取消",style: TextStyle(fontSize: 18),)),
              TextButton(onPressed: (){
                if (_controller.updateWorkTypeGroup.value != _controller.updateSinglePersonWork){
                  if((int.tryParse(_controller.updateQuantity.value.text) ?? 0) < 1){
                    EasyLoading.showError("请输入多人产品数量");
                    return;
                  }
                  if((int.tryParse(_controller.updateTeamSize.value.text) ?? 0) < 2){
                    EasyLoading.showError("团队人数需要大于1");
                    return;
                  }
                }
                if (_controller.updateWorkTypeGroup.value != _controller.updateMultiPersonWork){
                  if((int.tryParse(_controller.updateSingleQuantity.value.text) ?? 0) < 1){
                    EasyLoading.showError("请输入个人产品数量");
                    return;
                  }
                }
                if(_controller.updatePrice.value.text.isEmpty){
                  EasyLoading.showError("请输入单价");
                  return;
                }
                _controller.updateWorkRecords(workRecords);
                Get.back();
              }, child: const Text("更新",style: TextStyle(fontSize: 18),))
            ],
          );
        });


  }

  void showAddWorkRecordsDialog(DeviceScreenType screenType) async {
    await showDialog(context: context, builder: (ctx){
      return AlertDialog(
        title: Text("添加新的记录",style: Theme.of(context).textTheme.titleSmall,),
        contentPadding: EdgeInsets.only(left: 5.getScaleUpWidth(screenType),right: 5.getScaleUpWidth(screenType),top: 2.getScaleUpWidth(screenType),bottom: 1.getScaleUpWidth(screenType)),
        content: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.center,
          mainAxisSize: MainAxisSize.min,
          children: [
            ListTile(
              leading: Icon(Icons.calendar_month_rounded,color: Theme.of(context).colorScheme.primary,),
              title: Obx(() => Text(_controller.workDate.value,style: Theme.of(context).textTheme.bodySmall,)),
              subtitle: Text("点击可选择时间",style: Theme.of(context).textTheme.bodySmall,),
              titleAlignment: ListTileTitleAlignment.center,
              onTap: (){
                showChooseDateDialog();
              },
            ),
            const SizedBox(width: double.infinity,height: 10,),
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Obx(()=>Radio<int>(
                  value: _controller.singlePersonWork,
                  groupValue: _controller.workTypeGroup.value,
                  onChanged: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.singlePersonWork;
                  },
                )
                ),
                GestureDetector(
                  child: Text("个人",style: Theme.of(context).textTheme.titleSmall,),
                  onTapUp: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.singlePersonWork;
                  },
                ),
                Obx(()=>Radio<int>(
                  value: _controller.multiPersonWork,
                  groupValue: _controller.workTypeGroup.value,
                  onChanged: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.multiPersonWork;
                  },
                )
                ),
                GestureDetector(
                  child: Text("多人",style: Theme.of(context).textTheme.titleSmall),
                  onTapUp: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.multiPersonWork;
                  },
                ),
                Obx(()=>Radio<int>(
                  value: _controller.mixedWork,
                  groupValue: _controller.workTypeGroup.value,
                  onChanged: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.mixedWork;
                  },
                )
                ),
                GestureDetector(
                  child: Text("混合",style: Theme.of(context).textTheme.titleSmall),
                  onTapUp: (d){
                    clearInputText();
                    _controller.workTypeGroup.value = _controller.mixedWork;
                  },
                ),
              ],
            ),
            Obx(() => Visibility(
              visible: _controller.workTypeGroup.value != _controller.multiPersonWork,
              maintainAnimation: false,
              maintainSize: false,
              maintainState: false,
              child: Container(
                margin: const EdgeInsets.only(top: 20,left: 15,right: 15),
                child: TextField(
                  textAlign: TextAlign.center,
                  controller: _controller.addSingleQuantity,
                  style: Theme.of(context).textTheme.bodySmall,
                  decoration: InputDecoration(
                      labelText: "个人产品数量",
                      hintText: "请输入个人产品数量",
                      hintStyle: Theme.of(context).textTheme.bodySmall,
                      border: UnderlineInputBorder(
                          borderSide: BorderSide(width: .1,color: Theme.of(context).colorScheme.primary)
                      ),
                      labelStyle: Theme.of(context).textTheme.bodySmall
                  ),
                ),
              ),
            ),),
            Obx(() => Visibility(
              visible: _controller.workTypeGroup.value != _controller.singlePersonWork,
              maintainAnimation: false,
              maintainSize: false,
              maintainState: false,
              child: Container(
                margin: const EdgeInsets.only(top: 20,left: 15,right: 15),
                child: TextField(
                  textAlign: TextAlign.center,
                  controller: _controller.addQuantity,
                  style: Theme.of(context).textTheme.bodySmall,
                  decoration: InputDecoration(
                      labelText: "多人产品数量",
                      hintText: "请输入多人产品数量",
                      hintStyle: Theme.of(context).textTheme.bodySmall,
                      border: UnderlineInputBorder(
                          borderSide: BorderSide(width: .1,color: Theme.of(context).colorScheme.primary)
                      ),
                      labelStyle: Theme.of(context).textTheme.bodySmall
                  ),
                ),
              ),
            )),
            Container(
              margin: const EdgeInsets.only(top: 10,left: 15,right: 15),
              child: TextField(
                textAlign: TextAlign.center,
                controller: _controller.addPrice,
                style: Theme.of(context).textTheme.bodySmall,
                decoration: InputDecoration(
                    labelText: "产品单价",
                    hintText: "请输入产品单价",
                    hintStyle: Theme.of(context).textTheme.bodySmall,
                    border: const UnderlineInputBorder(),
                    labelStyle: Theme.of(context).textTheme.bodySmall
                ),
              ),
            ),
            Obx(() => Visibility(
              visible: _controller.workTypeGroup.value != _controller.singlePersonWork,
              maintainAnimation: false,
              maintainSize: false,
              maintainState: false,
              child: Container(
                margin: const EdgeInsets.only(top: 10,left: 15,right: 15),
                child: TextField(
                  textAlign: TextAlign.center,
                  controller: _controller.addTeamSize,
                  style: Theme.of(context).textTheme.bodySmall,
                  decoration: InputDecoration(
                      labelText: "团队人数",
                      hintText: "请输入团队人数",
                      hintStyle: Theme.of(context).textTheme.bodySmall,
                      border: const UnderlineInputBorder(),
                      labelStyle: Theme.of(context).textTheme.bodySmall
                  ),
                ),),
            )),
            Container(
              margin: const EdgeInsets.only(top: 20,left: 10,right: 10,bottom: 20),
              child: SizedBox(
                width: double.infinity,
                height: 55,
                child: ElevatedButton(
                    onPressed: (){
                      if (_controller.workTypeGroup.value != _controller.singlePersonWork){
                        if((int.tryParse(_controller.addQuantity.value.text) ?? 0) < 1){
                          EasyLoading.showError("请输入多人产品数量");
                          return;
                        }
                        if((int.tryParse(_controller.addTeamSize.value.text) ?? 0) < 2){
                          EasyLoading.showError("团队人数需要大于1");
                          return;
                        }
                      }
                      if(_controller.addPrice.value.text.isEmpty){
                        EasyLoading.showError("请输入单价");
                        return;
                      }
                      if (_controller.workTypeGroup.value != _controller.multiPersonWork){
                        if((int.tryParse(_controller.addSingleQuantity.value.text) ?? 0) < 1){
                          EasyLoading.showError("请输入个人产品数量");
                          return;
                        }
                      }
                      Get.back();
                      _controller.submitWorkRecord();
                    },
                    child: Text("提交工作记录",style: Theme.of(context).textTheme.bodySmall,)
                ),
              ),
            )
          ],
        ),
      );
    });
  }

  void clearInputText(){
    _controller.addSingleQuantity.text = "";
    _controller.addQuantity.text = "";
    _controller.addTeamSize.text = "";
    _controller.addPrice.text = "";
  }

  void showChooseDateDialog() async {
    var time = await showDatePicker(
      context: context,
      initialEntryMode: DatePickerEntryMode.calendarOnly,
      initialDate: DateTime.now(),
      firstDate: DateTime(2010),
      lastDate: DateTime.now(),
    );
    if (time != null){
      _controller.workDate.value = "${time.year.toString()}-${time.month.toString().padLeft(2,'0')}-${time.day.toString().padLeft(2,'0')}";
    }

  }

  Widget copyRight() {
    return Container(
      width: double.infinity,
      alignment: Alignment.center,
      margin: const EdgeInsets.only(top: 50),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text("版本: 2.0.0.0",style: Theme.of(context).textTheme.labelSmall,),
          Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SelectableText("作者： Straosp",style: Theme.of(context).textTheme.labelSmall,),
              TextButton(onPressed: () async {
                var url = "https://github.com/Straosp";
                if ( await canLaunchUrl(Uri.parse(url))) {
                  await launchUrl(Uri.parse(url),webOnlyWindowName: "_blank");
                }else {
                  print("打不开了");
                }
              }, child: Text("Github: https://github.com/Straosp",style: Theme.of(context).textTheme.labelSmall,)),
            ],
          ),
        ],
      ),
    );
  }

}